#ifndef __WAVE_GEN_H__
#define __WAVE_GEN_H__

#include "main.h"

#define OSCILLATOR_MAX_NUM 2
#define WAVE_SAMPLE_NUM 1000
#define DITHER_INTERVAL 500
#define DITHER_COEFFICIENT_NUM 8
#define VOLUME_DEFAULT_VALUE  2
#define PITCH_DEFAULT_VALUE  1
#define TIMBRE_DEFAULT_VALUE  0
#define DITHER_DEFAULT_VALUE  0

#define TIMBRE_MAX_NUM 4
#define PITCH_MAX_NUM 3
#define DITHER_MAX_NUM 2
#define VOLUME_MAX_NUM 5

#define TONE_A2  110
#define TONE_AS2 117
#define TONE_B2  123
#define TONE_C3  131
#define TONE_CS3 139
#define TONE_D3  147
#define TONE_DS3 156
#define TONE_E3  165
#define TONE_F3  175
#define TONE_FS3 185
#define TONE_G3  196
#define TONE_GS3 208
#define TONE_A3  220
#define TONE_AS3 233
#define TONE_B3  247
#define TONE_C4  262
#define TONE_CS4 277
#define TONE_D4  294
#define TONE_DS4 311
#define TONE_E4  330
#define TONE_F4  349
#define TONE_FS4 370
#define TONE_G4  392
#define TONE_GS4 415
#define TONE_A4  440
#define TONE_AS4 466
#define TONE_B4  494
#define TONE_C5  523
#define TONE_CS5 554
#define TONE_D5  587
#define TONE_DS5 622
#define TONE_E5  659
#define TONE_F5  698
#define TONE_FS5 740
#define TONE_G5  784
#define TONE_GS5 831
#define TONE_A5  880
#define TONE_AS5 932
#define TONE_B5  988
#define TONE_C6  1047
#define TONE_CS6 1109
#define TONE_D6  1175
#define TONE_DS6 1245
#define TONE_E6  1319

void WaveGenProcess(void);
void WaveGenInit(void);
void WaveGenSetTimbre(uint8_t OSC, uint8_t Timbre);
void WaveGenSetDither(uint8_t OSC, uint8_t Dither);
void WaveGenSetPitch(uint8_t OSC, uint8_t Pitch);
void WaveGenSetAmplitude(uint8_t OSC, uint8_t Amplitude);
void WaveGenPitchStart(uint8_t OSC, uint8_t PitchNum);
void WaveGenPitchStop(uint8_t OSC);


#endif 

